import { BaseModel } from '@/common/base/base.model';
import { Column, Entity, OneToOne } from 'typeorm';
import { AudioSynthesisStatus } from "common/utils/data";
import { ArticleExtModel } from "@/module/article-ext/article-ext.model";
import {
  AudioSynthesisEarbuds2earbudsModel
} from "@/module/audio-synthesis-earbuds2earbuds/audio-synthesis-earbuds2earbuds.model";

@Entity('AUDIO_SYNTHESIS', {
  synchronize: false,
}) // 品牌
export class AudioSynthesisModel extends BaseModel {
  @Column({
    comment: '状态',
    type: 'varchar',
    default: AudioSynthesisStatus.WAITING,
  })
  status: AudioSynthesisStatus;

  @Column({
    comment: '当前数据',
    type: 'varchar',
    length: 500,
  })
  currentName: string;

  @Column({
    comment: '目标数据',
    type: 'varchar',
    length: 500,
  })
  targetName: string;

  @Column({
    comment: '文件',
    type: 'varchar',
    length: 500,
  })
  currentAudioFile: string;

  @Column({
    comment: '文件',
    type: 'varchar',
    length: 500,
  })
  targetAudioFile: string;

  @Column({
    comment: '描述',
    type: 'uuid',
  })
  userUuid: string;

  @Column({
    comment: '错误原因',
    type: 'varchar',
    length: 5000,
  })
  errorReason: string;

  @OneToOne(() => AudioSynthesisEarbuds2earbudsModel, (model) => model.audioSynthesis)
  audioSynthesisEarbuds2earbuds: AudioSynthesisEarbuds2earbudsModel;
}
